<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii"/>
<title>MG4 --- MrSID Generation 4 for LiDAR</title>
</head>

<body>

<h1>MrSID/MG4 LiDAR Compression / Point Cloud View files</h1>

<p>This driver provides a way to view MrSID/MG4 compressed LiDAR file as a
raster DEM. The specifics of the conversion depend on the desired cellsize,
filter criteria, aggregation methods and possibly several other parameters.
For this reason, <b>the best way to read a MrSID/MG4 compressed LiDAR file
is by referencing it in a View (.view) file, which also parameterizes its
raster-conversion.  The driver will read an MG4 file directly, however it
uses default rasterization parameters that may not produce a desirable
output.</b>  The contents of the View file are described in the specification
<a href="frmt_mrsid_lidar_view_point_cloud.html">MrSID/MG4 LiDAR View Documents</a>.</p>

<p>MrSID/MG4 is a wavelet-based point-cloud compression technology. You may
think of it like a LAS file, only smaller and with a built in spatial index.
It is developed and distributed by LizardTech. This driver supports reading
of MG4 LiDAR files using LizardTech's decoding software development kit (DSDK).
<b>This DSDK is freely distributed; but, it is not open source software.
You should contact LizardTech to obtain it (see link at end of this page).</b>
</p>

<h2>Example View files (from View Document specification)</h2>

<h3>Simplest possible .view file</h3>

<p>The simplest way to view an MG4 file is to wrap it in a View (.view) file
like this.  Here, the relative reference to the MG4 file means that the file
must exist in the same directory as the .view file.  Since we're not mapping
any bands explicitly, we get the default, which is elevation only.  By default,
we aggregate based on mean.  That is, if two (or more) points land on a single
cell, we will expose the average of the two.  There's no filtering here so
we'll get all the points regardless of classification code or return number.
Since the native datatype of elevation is "Float64", that is the datatype of
the band we will expose.</p>

<pre>
&lt;PointCloudView&gt;
   &lt;InputFile&gt;Tetons.sid&lt;/InputFile&gt;
&lt;/PointCloudView&gt;
</pre>

<h3>Crop the data</h3>

<p>This is similar to the example above but we are using the optional ClipBox
tag to select a 300 meter North-South swatch through the cloud. If we wanted
to crop in the East-West directions, we could have specified that explicitly
instead of using NOFITLER for those. Similarly, we could also have cropped in
the Z direction as well.</p>

<pre>
&lt;PointCloudView&gt;
   &lt;InputFile&gt;Tetons.sid&lt;/InputFile&gt;
   &lt;ClipBox&gt;505500 505800 NOFILTER NOFILTER&lt;/ClipBox&gt;
&lt;/PointCloudView&gt;
</pre>

<h3>Expose as a bare earth (Max) DEM</h3>

<p>Here, we expose a single band (elevation) but we want only those points that
have been classified as "Ground".  The ClassificationFilter specifies a value
of 2 - the ASPRS Point Class code that stipulates "Ground" points.
 Additionally, instead of the default "Mean" aggregation method, we specify
"Max". This means that if two (or more) points land on a single cell, we expose
the larger of the two elevation values.</p>

<pre>
&lt;PointCloudView&gt;
   &lt;InputFile&gt;E:\ESRIDevSummit2010\Tetons.sid&lt;/InputFile&gt;
   &lt;Band&gt; &lt;!-- Max Bare Earth--&gt;
      &lt;Channel&gt;Z&lt;/Channel&gt;
      &lt;AggregationMethod&gt;Max&lt;/AggregationMethod&gt;
      &lt;ClassificationFilter&gt;2&lt;/ClassificationFilter&gt;
   &lt;/Band&gt;
&lt;/PointCloudView&gt;
</pre>

<h3>Intensity image</h3>

<p>Here we expose an intensity image from the point cloud.</p>

<pre>
&lt;PointCloudView&gt;
   &lt;InputFile&gt;Tetons.sid&lt;/InputFile&gt;
   &lt;Band&gt;
      &lt;!-- All intensities --&gt;
      &lt;Channel&gt;Intensity&lt;/Channel&gt;
   &lt;/Band&gt;
&lt;/PointCloudView&gt;
</pre>

<h3>RGB image</h3>

<p>Some point cloud images include RGB data. If that's the case, you can use
a .view file like this to expose that data.</p>

<pre>
&lt;PointCloudView&gt;
   &lt;InputFile&gt;Grass Lake Small.xyzRGB.sid&lt;/InputFile&gt;
   &lt;Band&gt;
      &lt;Channel&gt;Red&lt;/Channel&gt;
   &lt;/Band&gt;
   &lt;Band&gt;
      &lt;Channel&gt;Green&lt;/Channel&gt;
   &lt;/Band&gt;
   &lt;Band&gt;
      &lt;Channel&gt;Blue&lt;/Channel&gt;
   &lt;/Band&gt;
&lt;/PointCloudView&gt;
</pre>

<h2>Writing not supported</h2>

<p>This driver does not support writing MG4 files.</p>

<h2>Limitations of current implementation</h2>

<p>Only one <i>&lt;InputFile&gt;</i> tag is supported. It must reference an MG4
file.</p>

<p>The only <i>&lt;InterpolationMethod&gt;</i> that is supported is
<i>&lt;None&gt;</i> (default).  Use this to specify a NODATA value if the
default (maximum value of the datatype) is not what you want. See View
Specification for details.</p>

<p>There is insufficient error checking for format errors and invalid
parameters.  Many invalid entries will likely fail silently.</p>

<h2>See Also:</h2>

<ul>
 <li>Implemented as <i>gdal/frmts/mrsid_lidar/gdal_MG4Lidar.cpp</i></li>
 <li><a href="frmt_mrsid_lidar_view_point_cloud.html">MrSID/MG4 LiDAR View Document Specification</a></li>
 <li><a href="http://www.lizardtech.com">LizardTech's Web site</a></li>
</ul>

</body>

</html>
